import Vue from 'vue';
import App from './App';
import router from './router';
import https from './utils/request';
import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
import 'vant/lib/index.css';
import './assets/css/icon.css';
import './assets/css/main.css';
import 'animate.css';
import {getConfig} from "@/api/index";
import dateFormat from "@/utils/dateFormat";
import waterfall from 'vue-waterfall2';
import ElementUI from 'element-ui';
import uploader from 'vue-simple-uploader';
import { ImagePreview } from 'vant';
import VueClipBoard from 'vue-clipboard2'
import store from './store/store';
Vue.use(ElementUI, {
    size: 'medium'
});
Vue.use(waterfall)
Vue.use(uploader)
Vue.use(ImagePreview)
Vue.use(VueClipBoard)
const isMobild=()=>{
  if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
    document.documentElement.style.fontSize = document.documentElement.clientWidth / 640 * 100 + 'px';
    return true
  }
}
getConfig().then(
  (apis) => {
    new Vue({
      router,
      store,
      el: '#app',
      render: h => h(App),
      beforeMount() {
        Vue.prototype.$http = https;
        Vue.prototype.$isMobile = isMobild() || false;
        Vue.prototype.$API = apis;
        Vue.prototype.$DATEFORMAT = dateFormat;
        Vue.prototype.$TIMERS = false;
      }
    });
  }
);




